<?php
/**
 * Created by PhpStorm.
 * User: yellow
 * Date: 2019/6/25
 * Time: 14:10
 */

namespace app\common\model;


use think\Model;

class Exchange extends Model
{

    public function ExchangeCate(){
        return $this->hasOne('ExchangeCate', 'id', 'cate_id')->bind([
            'cate_name'=>'name'
        ]);
    }

    public function getThumbAttr($value){
        return $value?config('database.img_url').$value:'';
    }

    public function getUseTimeAttr($value){
        return date('Y-m-d H:i',$value);
    }

    public function getEndTimeAttr($value){
        return date('Y-m-d H:i',$value);
    }

    public function getContentAttr($value){
        return htmlspecialchars_decode($value);
    }

}